home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / wfc007.000 / include / cnetconn.hpp < prev    next >
C/C++ Source or Header  |  1996-04-08  |  2KB  |  78 lines

  1. #if ! defined( NETWORK_CONNECTION_CLASS_HEADER )
  2.  
  3. /*
  4. ** Author: Samuel R. Blackburn
  5. ** CI$: 76300,326
  6. ** Internet: sammy@sed.csc.com
  7. **
  8. ** You can use it any way you like.
  9. */
  10.  
  11. #define NETWORK_CONNECTION_CLASS_HEADER
  12.  
  13. class CNetworkConnectionInformation : public CObject
  14. {
  15.    DECLARE_SERIAL( CNetworkConnectionInformation )
  16.  
  17.    private:
  18.  
  19.       void m_Initialize( void );
  20.  
  21.    public:
  22.  
  23.       CNetworkConnectionInformation();
  24.       CNetworkConnectionInformation( CONNECTION_INFO_1 *information_p );
  25.       virtual ~CNetworkConnectionInformation();
  26.  
  27.       DWORD   ID;
  28.       DWORD   Type;
  29.       DWORD   NumberOfUsers;
  30.       DWORD   NumberOfOpens;
  31.       DWORD   Time;
  32.       CString UserName;
  33.       CString NetName;
  34.  
  35.       virtual void Copy( CONNECTION_INFO_1 *source );
  36.       virtual void Empty( void );
  37.       virtual void Serialize( CArchive& archive );
  38. };
  39.  
  40. class CNetworkConnections : public CNetwork
  41. {
  42.    DECLARE_SERIAL( CNetworkConnections )
  43.  
  44.    private:
  45.  
  46.       void m_Initialize( void );
  47.  
  48.    protected:
  49.  
  50.       /*
  51.       ** Connection information variables
  52.       */
  53.  
  54.       CONNECTION_INFO_1 *m_1InformationBuffer;
  55.  
  56.       /*
  57.       ** File Information enumeration variables
  58.       */
  59.  
  60.       DWORD m_1ResumeHandle;
  61.       DWORD m_1CurrentEntryNumber;
  62.       DWORD m_1NumberOfEntriesRead;
  63.       DWORD m_1TotalNumberOfEntries;
  64.  
  65.    public:
  66.  
  67.       CNetworkConnections();
  68.       CNetworkConnections( LPCTSTR machine_name );
  69.       virtual ~CNetworkConnections();
  70.  
  71.       virtual void  Close( void );
  72.       virtual BOOL  Enumerate( LPCTSTR share_or_computer_name );
  73.       virtual BOOL  GetNext( CNetworkConnectionInformation& information );
  74.       virtual void  Serialize( CArchive& archive );
  75. };
  76.  
  77. #endif // NETWORK_CONNECTION_CLASS_HEADER
  78.